from rest_framework import serializers
from . import models

class CouponModelSerializer(serializers.ModelSerializer):
    class Meta:
        model = models.Coupon
        fields = ['id','name','condition','coupon_type','sale']

class UserCouponModelSerializer(serializers.ModelSerializer):
    coupon = CouponModelSerializer()
    class Meta:
        model = models.UserCoupon
        fields = ['id','start_time','end_time','coupon']